home *** CD-ROM | disk | FTP | other *** search
- package mx.utils
- {
- import flash.utils.Dictionary;
- import mx.core.mx_internal;
-
- use namespace mx_internal;
-
- public class XMLNotifier
- {
- private static var instance:XMLNotifier;
-
- mx_internal static const VERSION:String = "2.0.1.0";
-
- public function XMLNotifier(param1:XMLNotifierSingleton)
- {
- super();
- }
-
- public static function getInstance() : XMLNotifier
- {
- if(!instance)
- {
- instance = new XMLNotifier(new XMLNotifierSingleton());
- }
- return instance;
- }
-
- mx_internal static function initializeXMLForNotification(param1:XML) : Function
- {
- var notificationFunction:Function = null;
- var node:XML = param1;
- notificationFunction = function(param1:Object, param2:String, param3:Object, param4:Object, param5:Object):void
- {
- var _loc7_:Dictionary = null;
- var _loc8_:Object = null;
- _loc7_ = arguments.callee.watched;
- if(_loc7_ != null)
- {
- for(_loc8_ in _loc7_)
- {
- IXMLNotifiable(_loc8_).xmlNotification(param1,param2,param3,param4,param5);
- }
- }
- };
- node.setNotification(notificationFunction);
- return notificationFunction;
- }
-
- public function watchXML(param1:Object, param2:IXMLNotifiable) : void
- {
- var _loc3_:XML = null;
- var _loc4_:Object = null;
- var _loc5_:Dictionary = null;
- _loc3_ = XML(param1);
- _loc4_ = _loc3_.notification();
- if(!(_loc4_ is Function))
- {
- _loc4_ = mx_internal::initializeXMLForNotification(_loc3_);
- }
- if(_loc4_["watched"] == undefined)
- {
- _loc4_["watched"] = _loc5_ = new Dictionary(true);
- }
- else
- {
- _loc5_ = _loc4_["watched"];
- }
- _loc5_[param2] = true;
- }
-
- public function unwatchXML(param1:Object, param2:IXMLNotifiable) : void
- {
- var _loc3_:XML = null;
- var _loc4_:Object = null;
- var _loc5_:Dictionary = null;
- _loc3_ = XML(param1);
- _loc4_ = _loc3_.notification();
- if(!(_loc4_ is Function))
- {
- _loc4_ = mx_internal::initializeXMLForNotification(_loc3_);
- }
- if(_loc4_["watched"] != undefined)
- {
- _loc5_ = _loc4_["watched"];
- delete _loc5_[param2];
- }
- }
- }
- }
-
- class XMLNotifierSingleton
- {
- public function XMLNotifierSingleton()
- {
- super();
- }
- }
-